# Create your views here.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from mysites.couch.forms import MessageForm
from mysites.couch.models import Message
from django.template import RequestContext

def message(request):
    form = MessageForm()
    
    if request.method =='POST':
        message = Message()
        form = MessageForm(request.POST,instance=message)
        if form.is_valid():
            cd = form.cleaned_data
            form.save()
        return render_to_response('message_form.html',locals(),context_instance=RequestContext(request))
    #return render_to_response('message_form.html',{'form':form})
    return render_to_response('message_form.html',locals(),context_instance=RequestContext(request))



    